package com.game.league.market.adapter;

import android.app.Activity;

import com.game.base.app.base.BaseAdapter;
import com.game.base.app.callback.ItemOnClick;
import com.game.base.glideV4.ImageLoader;
import com.game.base.utils.DecimalUtil;
import com.game.league.R;
import com.game.league.databinding.AdapterMarketBinding;
import com.game.league.task.table.Task;

/**
 * 每日发现
 * Created by Su on 2019/6/20.
 */
public class MarketAdapter extends BaseAdapter<Task, AdapterMarketBinding> {

    public MarketAdapter(Activity activity, ItemOnClick itemOnClick) {
        super(activity, itemOnClick);
    }

    @Override
    protected int getLayoutResId(int viewType) {
        return R.layout.adapter_market;
    }

    @Override
    protected void onBindItem(AdapterMarketBinding binding, Task item, int position) {
        ImageLoader.loadRoundCenterCrop(mActivity, item.getImage(), binding.ivAppLogo);
        binding.tvAppName.setText(item.getTitle());
        binding.tvCoinAdd.setText("+ " + DecimalUtil.getFormatFloat(item.getPrice()));
        binding.tvChannel.setText(item.getChannel());
        binding.tvSample.setText(item.getSampleDescription());
    }
}
